/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cafeinebeverage;

import java.io.*;

/**
 *
 * @author skipy
 */
public class TeaWithHook extends CaffeineBeverageWithHook {
    
     @Override
    public void brew()
    {
    System.out.println("Se invuzeaza ceaiul!");
    }
    @Override
    public void addCondiments()
    {
    System.out.println("Se adauga lamaia!");
    }
    public boolean costumerWantsCondiments()
    {
        String answer = getUserInput();
        if(answer.toLowerCase().startsWith("y"))
        {return true;}
        else return false;
        
    }

    private String getUserInput() {
       String answer = null;
       System.out.println("Doriti lamaie ? [y/n]");
       BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
       try
       {
       answer = in.readLine();
       }
       catch(IOException ioe)
       {
       System.err.println("A aparut o eroare incercand sa citesc raspunsul");
       }
       if(answer==null)
       {
       return "no";
       }
       return answer;
    }
}
